<#include "user_manager_header.ftl">

			<ul class="nav nav-tabs">
			  <li><a href="dicttype_list">管理字典类别</a></li>
			  <li class="active"><a>增加字典类别</a></li>
			  <li><a>管理字典条目</a></li>
			  <li><a>增加字典条目</a></li>
			</ul>
			
			<div><p></p></div>

			<div class="panel panel-default">
			   <div class="panel-body">

					<form class="form-horizontal" role="form" id="form" method="post" action="dicttype_create">
					  <div class="form-group">
					    <label for="typename" class="col-sm-2 control-label">类别名称</label>
					    <div class="col-sm-6">
					      <input type="hidden" class="form-control" value="${action?if_exists}" name="action" id="action"/>
					      <input type="text" class="form-control" value="${(dicttype.typeName)?if_exists}" name="typename" id="typename"  placeholder="类别名称" required autofocus/>
					    </div>
					  </div>
					  					  
					   <div class="form-group">
					    <label for="typename" class="col-sm-2 control-label">类别编码</label>
					    <div class="col-sm-6">
					      <input type="text" class="form-control" value="${(dicttype.typeCode)?if_exists}" name="typecode" id="typecode" placeholder="类别编码" required/>
					    </div>
					  </div>
					  
					  
					  
					  
					  
					  					  
					  <div class="form-group">
					    <label class="col-sm-2 control-label">是否国标</label>
					    <div class="col-sm-6">
							<select class="selectpicker" id="standard" name="standard" required>
							    <option value="false">否</option>
							    <option value="true">是</option>
							</select>  
					    </div>					    
					  </div>
					  <div class="form-group">
					    <label class="col-sm-2 control-label">能否修改</label>
					    <div class="col-sm-6">
							<select class="selectpicker" id="writable" name="writable" required>
							    <option value="true">是</option>
							    <option value="false">否</option>
							</select>  
					    </div>					    
					  </div>
					  
					  <div class="form-group">
					    <label for="typename" class="col-sm-2 control-label">当前版本</label>
					    <div class="col-sm-6">
					      <input type="text" class="form-control" value="${(dicttype.version)?if_exists}" name="version" id="version" placeholder="当前版本" required/>
					    </div>
					  </div>	
					  
					  <div class="form-group">
					    <div class="col-sm-offset-2 col-sm-10">
					      <button type="submit" class="btn btn-default" ${typecode?if_exists}>提交</button>
					    </div>
					  </div>
					</form>
			      
			   </div> <!--/panel-body-->

			</div>	<!--/panel-->			
			
<#include "user_manager_footer.ftl">

<script type="text/javascript">

$().ready(function() {

	//
	$('.selectpicker').selectpicker();
	
	
	
	if(document.getElementById("action").value == "UPDATE")
	{
		document.getElementById("typecode").readOnly=true;
	}

	//
	$("#form").validate({
		rules: {
			version: {
				required: true,
				digits:true
			},
		},
		messages: {
			version: {
				required: "请输入数字",
				digits: "必须为整型数字"
			},
		}
	});

});


	      
</script>  
